//
//  LearnerView.m
//  Pennyworth
//
//  Created by Chris Karr on 3/30/08.
//  Copyright 2008 Chris J. Karr. All rights reserved.
//

#import "LearnerView.h"

@implementation LearnerView

- (void) setActiveLearner:(NSString *) learner
{
	activeLearner = learner;
	
	Learner * l = [user learnerNamed:activeLearner];
	
	NSString * html = [l htmlRepresentation];
	
	[[webView mainFrame] loadHTMLString:html 
		baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] resourcePath]]];
}

- (NSString *) activeLearner
{
	if (activeLearner == nil)
		[self setActiveLearner:@"Activity"];
		
	return activeLearner;
}

- (IBAction) refresh:(id) sender
{
	[self setActiveLearner:activeLearner];
}

@end
